import request from '../util/request'
import {
  TypeRoleListAPI,
  TypeSearchInfoAPI,
  TypeUpdatePermissionAPI,
  TypeAddRoleAPI,
  TypeEditRoleAPI,
  TypeDeleteRoleAPI
} from '../type/api'
//获取角色列表
export function getRoleListAPI(params?: TypeSearchInfoAPI) {
  return request.get<TypeRoleListAPI>('/roles/list', params || {})
}
//添加角色
export function addRoleListAPI(params: TypeAddRoleAPI) {
  return request.post('/roles/create', params)
}
//编辑角色
export function editRoleListAPI(params: TypeEditRoleAPI) {
  return request.post('/roles/edit', params)
}
//删除角色
export function deleteRoleListAPI(params: TypeDeleteRoleAPI) {
  return request.post('/roles/delete', params)
}
//设置权限
export function setPermissionListAPI(params: TypeUpdatePermissionAPI) {
  return request.post('/roles/update/permission', params)
}
